home *** CD-ROM | disk | FTP | other *** search
- Path: news.datasync.com!news
- From: drackull@datasync.com (Eddy B Drackull)
- Newsgroups: comp.lang.c++
- Subject: Re: Using multiple functions in one file
- Date: 13 Jan 1996 06:06:57 GMT
- Organization: RK Inspection Service Inc.
- Message-ID: <4d7i61$i3e@osh2.datasync.com>
- References: <DL00rI.HFr@cunews.carleton.ca>
- NNTP-Posting-Host: os-ppp25.datasync.com
- X-Newsreader: WinVN 0.92.6
-
- In article <DL00rI.HFr@cunews.carleton.ca>, abelo@chat.carleton.ca (Andrew Belo) says:
- >
- >
- >I have written an example program out of a book and it keeps giving me an
- >error that says "Call to undefined function 'butler' in function main()"
- >I am using Borland C++ for Dos, Win and Win 32 Version 4.5.
- >
- >The book is called C: Step by Step, and the program is as follows.
-
- try this
-
- /* two_func.c -- a program using two functions in one file */
- #include <stdio.h>
-
- void butler(void);/*declar a function befor using it*/
- /*you could switch the order of butler() and main and it will also work*/
- main()
- {
- printf("I will summon the butler function. \n");
- butler();
- printf("Yes. Bring me some tea and floppy disks.\n");
- }
- butler()
- {
- printf("You rang, sir? \n");
- }
-
- >----------------------------------------------------------------------------
- >Andrew Belo | WARNING: Yes this message has spelling mistakes but
- >1st Year Computer Sci | learn to live with it!!!!!!!!
- >Carleton University ------------------------------------------------------
- >Email address: abelo@chat.carleton.ca
- > ai806@FreeNet.Carleton.CA
- >Home Page: chat.carleton.ca/~abelo
- >----------------------------------------------------------------------
- >
-
-
- bye drackull
-